feat(cluster): add worker nodes from the UI (WireGuard mesh) - #16
Merged
Merged
Conversation
…eGuard mesh) Turns the manually-proven multi-node setup into a product feature. - nomad-cluster.ts: getClusterWorkerJoinCommand() generates a script (run over SSH) that installs Docker+Consul+Nomad+CNI+WireGuard on a worker, joins the WireGuard overlay (peers with the hub), and starts Consul/Nomad as clients that retry-join the hub. Prints WORKER_WG_PUBKEY for the hub to register. - nomad.joinCluster tRPC subscription: reads /etc/nomploy/cluster.json, allocates the next overlay IP, runs the join script (streaming), registers the worker's WireGuard peer on the hub (wg set + wg-quick save), persists the peer, and sets the server's nomadAddress. - install.sh: control plane is now a WireGuard hub (wg0 10.10.0.1, gossip encryption); Consul/Nomad bind to the overlay (HTTP still on 127.0.0.1 for the app); writes /etc/nomploy/cluster.json. App runs with NET_ADMIN + /etc/wireguard mounted so it can manage hub peers. - Dockerfile: add wireguard-tools + iptables (app manages the hub's wg0). - UI: 'Join cluster' button + streamed logs in the server's Nomad settings. Manually verified end-to-end on two servers: WireGuard mesh + 2-node Nomad cluster + a count=2 job spread across both nodes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Thank you for your contribution! Please sign our Contributor License Agreement by posting the following comment: I have read the CLA Document and I hereby sign the CLA Peter Gonda seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Productizes multi-node Nomad clustering (verified manually on 2 servers: WG mesh + 2 Nomad nodes + count=2 job spread across both).
getClusterWorkerJoinCommand()— worker install + WireGuard join + Consul/Nomad client, prints its WG pubkey.🤖 Generated with Claude Code